package com.onesports.intelligent.k12.polarlight.service.course;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.onesports.intelligent.k12.polarlight.domain.entity.course.ClassStudentScheduleDetail;
import com.onesports.intelligent.k12.polarlight.mapper.course.ClassStudentScheduleDetailMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Wsy
 **/
@Service
@RequiredArgsConstructor
public class ClassStudentScheduleDetailService extends ServiceImpl<ClassStudentScheduleDetailMapper, ClassStudentScheduleDetail> {
    private final ClassStudentScheduleDetailMapper classStudentScheduleDetailMapper;

    public List<ClassStudentScheduleDetail> listByClassStudentIds(List<String> oldClassStudentIds) {
        return this.classStudentScheduleDetailMapper.selectList(new LambdaQueryWrapper<ClassStudentScheduleDetail>()
                .in(ClassStudentScheduleDetail::getClassStudentId,oldClassStudentIds));
    }


    public List<ClassStudentScheduleDetail> listStuScheduleDetail(List<String> classStudentIds, String scheduleDetailId) {
        return this.classStudentScheduleDetailMapper.selectList(new LambdaQueryWrapper<ClassStudentScheduleDetail>()
                .eq(ClassStudentScheduleDetail::getScheduleDetailId, scheduleDetailId)
                .in(ClassStudentScheduleDetail::getClassStudentId, classStudentIds));
    }
}
